package edpool;

import java.util.concurrent.atomic.AtomicBoolean;

public class ToggleBit
{
	private AtomicBoolean toggle = new AtomicBoolean(true);
	public boolean traverse()
    {
	   	boolean result;
	   	do{
	   	 result = toggle.get();
	   	}while(!toggle.weakCompareAndSet(result, !result));
	   	return result;
    }
}